package com.example.administrator.yunniuusedcar.holder;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.example.administrator.common.base.Global;
import com.example.administrator.common.base.MyApp;
import com.example.administrator.common.ui.BaseAdapterRV;
import com.example.administrator.common.ui.BaseHolderRV;
import com.example.administrator.yunniuusedcar.MainActivity;
import com.example.administrator.yunniuusedcar.R;
import com.example.administrator.yunniuusedcar.activity.ActionPromotionActivity;
import com.example.administrator.yunniuusedcar.activity.BuyingCarGuideActivity;
import com.example.administrator.yunniuusedcar.activity.DetailsCarActivity;
import com.example.administrator.yunniuusedcar.activity.HJingPingCarActivity;
import com.example.administrator.yunniuusedcar.activity.HaoCarJifenShopActivity;
import com.example.administrator.yunniuusedcar.activity.LinePhysicalStoreActivity;
import com.example.administrator.yunniuusedcar.activity.SeconHandCarActivity;
import com.example.administrator.yunniuusedcar.model.mode_benn.HomeMenuBean;
import com.example.administrator.yunniuusedcar.model.mode_benn.ShopImage_GridBean;
import com.example.administrator.yunniuusedcar.ui.ShopDetailActivity;
import com.squareup.picasso.Picasso;

/** 商品详情头部 汽车图册
 * Created by USER2015 on 2017/12/3.
 */

public class ShopCategoryHolder extends BaseHolderRV<ShopImage_GridBean.DataX> {

    private LinearLayout lll;

    public ShopCategoryHolder(Context context, ViewGroup parent,
                              BaseAdapterRV<ShopImage_GridBean.DataX> adapter) {
        super(context, parent, adapter, R.layout.activity_shop_info_imager);   // 内容   item_grild3
    }

    private ImageView ivIcon;

    // 查找子控件
    @Override
    public void onFindViews(View itemView) {
        ivIcon = (ImageView) itemView.findViewById(R.id.iv_CarImager1);    //    iv_image3

        // 设置itemView的宽度
        int width = (int) (Global.mScreenWidth / 3);
        ViewGroup.LayoutParams param = itemView.getLayoutParams();  //网格布局
        param.width = width;


        itemView.setLayoutParams(param);
    }

    // 刷新子控件显示
    @Override
    protected void onRefreshView(ShopImage_GridBean.DataX bean, int position) {

        Picasso.with(context).load(bean.data.get(position).logo).into(ivIcon);

    }

}

